class CreateGroupTeacherSchedules < ActiveRecord::Migration
  def self.up
    create_table :group_teacher_schedules do |t|
      t.references :group_schedule
      t.references :group_teacher
      t.references :interval

      t.timestamps
    end
    add_index(:group_teacher_schedules, [:group_schedule_id, :group_teacher_id, :interval_id],
      :unique => false, :name => "group_teacher_schedules_gsid_gtid_iid")
  end

  def self.down
    remove_index(:group_teacher_schedules, :name => "group_teacher_schedules_gsid_gtid_iid")
    drop_table :group_teacher_schedules
  end
end
